<!--
 * @Description: 
 * @Date: 2020-12-14 15:09:07
 * @LastEditors: lother
 * @LastEditTime: 2020-12-14 15:38:31
 * @FilePath: \AccounOpening-WEB\src\components\date\index.vue
-->
<template>
    <el-date-picker
      v-model="dateTime"
      :type="type"
      placeholder="选择日期"
      :format="format"
      :value-format="valueFormat"
      @change="changeTime">
    </el-date-picker>
</template>
<script>
export default {
    props:{
        value:{
            default:''
        },
        format:{
            type:String,
            default:''
        },
        valueFormat:{
            type:String,
            default:''
        },
        type:{
           type:String,
            default:'' 
        }
    },
    data() {
        return {
            dateTime:''
        }
    },
    created(){
        console.log(this.$props)
    },
    methods:{
        changeTime(val){
            console.log(val)
            this.$emit('input',val)
        }
    },
    watch:{
        value(val,old){
            this.dateTime = val
        },
        format(val,old){
            console.log(val,old)
        }
    }
}
</script>